<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QSqlIndex Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSqlIndex Class Reference<br /><sup><sup>[<a href="qtsql.html">QtSql</a> module]</sup></sup></h1><p>The QSqlIndex class provides functions to manipulate and
describe database indexes. <a href="#details">More...</a></p>

<p>Inherits <a href="qsqlrecord.html">QSqlRecord</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsqlindex.html#QSqlIndex">__init__</a></b> (<i>self</i>, QString&#160;<i>cursorName</i>&#160;=&#160;QString(), QString&#160;<i>name</i>&#160;=&#160;QString())</li><li><div class="fn" /><b><a href="qsqlindex.html#QSqlIndex-2">__init__</a></b> (<i>self</i>, QSqlIndex&#160;<i>other</i>)</li><li><div class="fn" /><b><a href="qsqlindex.html#append">append</a></b> (<i>self</i>, QSqlField&#160;<i>field</i>)</li><li><div class="fn" /><b><a href="qsqlindex.html#append-2">append</a></b> (<i>self</i>, QSqlField&#160;<i>field</i>, bool&#160;<i>desc</i>)</li><li><div class="fn" />QString <b><a href="qsqlindex.html#cursorName">cursorName</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsqlindex.html#isDescending">isDescending</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" />QString <b><a href="qsqlindex.html#name">name</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsqlindex.html#setCursorName">setCursorName</a></b> (<i>self</i>, QString&#160;<i>cursorName</i>)</li><li><div class="fn" /><b><a href="qsqlindex.html#setDescending">setDescending</a></b> (<i>self</i>, int&#160;<i>i</i>, bool&#160;<i>desc</i>)</li><li><div class="fn" /><b><a href="qsqlindex.html#setName">setName</a></b> (<i>self</i>, QString&#160;<i>name</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSqlIndex class provides functions to manipulate and
describe database indexes.</p>
<p>An <i>index</i> refers to a single table or view in a database.
Information about the fields that comprise the index can be used to
generate SQL statements.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSqlIndex" />QSqlIndex.__init__ (<i>self</i>, QString&#160;<i>cursorName</i>&#160;=&#160;QString(), QString&#160;<i>name</i>&#160;=&#160;QString())</h3><p>Constructs an empty index using the cursor name
<i>cursorname</i> and index name <i>name</i>.</p>


<h3 class="fn"><a name="QSqlIndex-2" />QSqlIndex.__init__ (<i>self</i>, <a href="qsqlindex.html">QSqlIndex</a>&#160;<i>other</i>)</h3><p>Constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="append" />QSqlIndex.append (<i>self</i>, <a href="qsqlfield.html">QSqlField</a>&#160;<i>field</i>)</h3><p>Appends the field <i>field</i> to the list of indexed fields.
The field is appended with an ascending sort order.</p>


<h3 class="fn"><a name="append-2" />QSqlIndex.append (<i>self</i>, <a href="qsqlfield.html">QSqlField</a>&#160;<i>field</i>, bool&#160;<i>desc</i>)</h3><p>This is an overloaded function.</p>
<p>Appends the field <i>field</i> to the list of indexed fields.
The field is appended with an ascending sort order, unless
<i>desc</i> is true.</p>


<h3 class="fn"><a name="cursorName" />QString QSqlIndex.cursorName (<i>self</i>)</h3><p>Returns the name of the cursor which the index is associated
with.</p>
<p><b>See also</b> <a href="qsqlindex.html#setCursorName">setCursorName</a>().</p>


<h3 class="fn"><a name="isDescending" />bool QSqlIndex.isDescending (<i>self</i>, int&#160;<i>i</i>)</h3><p>Returns true if field <i>i</i> in the index is sorted in
descending order; otherwise returns false.</p>


<h3 class="fn"><a name="name" />QString QSqlIndex.name (<i>self</i>)</h3><p>Returns the name of the index.</p>
<p><b>See also</b> <a href="qsqlindex.html#setName">setName</a>().</p>


<h3 class="fn"><a name="setCursorName" />QSqlIndex.setCursorName (<i>self</i>, QString&#160;<i>cursorName</i>)</h3><p>Sets the name of the cursor that the index is associated with to
<i>cursorName</i>.</p>
<p><b>See also</b> <a href="qsqlindex.html#cursorName">cursorName</a>().</p>


<h3 class="fn"><a name="setDescending" />QSqlIndex.setDescending (<i>self</i>, int&#160;<i>i</i>, bool&#160;<i>desc</i>)</h3><p>If <i>desc</i> is true, field <i>i</i> is sorted in descending
order. Otherwise, field <i>i</i> is sorted in ascending order (the
default). If the field does not exist, nothing happens.</p>
<p><b>See also</b> <a href="qsqlindex.html#isDescending">isDescending</a>().</p>


<h3 class="fn"><a name="setName" />QSqlIndex.setName (<i>self</i>, QString&#160;<i>name</i>)</h3><p>Sets the name of the index to <i>name</i>.</p>
<p><b>See also</b> <a href="qsqlindex.html#name">name</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>